package com.grahamedgecombe.jterminal;

import javax.swing.*;


/**
 * 嵌入系统
 *
 * public class View extends ViewPart {
 * 	public static final String ID = "HelloRCP.view";
 * 	private JPanel swingPanel;
 *
 * 	public void createPartControl(Composite parent) {
 * 		Composite composite = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
 * 		final Frame frame = SWT_AWT.new_Frame(composite);
 * 		SwingUtilities.invokeLater(new Runnable() {
 * 			public void run() {
 * 				swingPanel = new JPanel();
 * 				JButton button = new JButton("Swing Button");
 * 				swingPanel.add(button);
 * 				frame.add(swingPanel);
 *                        }* 		});
 * 	}
 * 	public void setFocus() {}
 * }
 *
 * https://blog.csdn.net/weixin_33738578/article/details/91909770
 */
public class Starter {

    public static void main(String[] args) {
        JFrame frame = new JFrame();
        JTerminal panel = new JTerminal();
        frame.getContentPane().add(panel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(300, 300);
        frame.setVisible(true);
        for (int i = 0; i < 500; i++) {
            panel.print("haha"+i);
        }
    }
}
